﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<iBuproModel.Project>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	My projects
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

	<h2>Projects in <% if (Model.FirstOrDefault() != null) {%> <%:Model.FirstOrDefault().Subject.Name %> <%} %></h2>

	<table>
    <thead>
		<tr>
			<th></th>
			<th>
				Name
			</th>
			<th>
				Detail
			</th>
			<th>
				Created
			</th>
			<th>
				Shortcut
			</th>
			<th>
				Subject
			</th>
            <th>
                Department
            </th>
		</tr>
        </thead>
    <tbody>
	<% foreach (var item in Model) { %>
	
		<tr>
			<td>
                <%: Html.ActionLink("Details", "Details", new { id=item.Id })%> |
				<%: Html.ActionLink("Edit", "Edit", new { id=item.Id })%> |
                <%: Html.ActionLink("Leave project", "Leave", new { id = item.Id})%>
				
			</td>
			<td>
				<%: item.Name %>
			</td>
			<td>
				<%: Html.TruncateDetail(item.Detail) %>
			</td>
			<td>
				<%: String.Format("{0:g}", item.Created) %>
			</td>
			<td>
				<%: item.Shortcut %>
			</td>
			<td>
				<%:item.Subject.Name %>
			</td>
            <td>
				<%:item.Subject.Department.Name %>
			</td>
		</tr>
	
	<% } %>
    </tbody>
	</table>

	<p>
		<%: Html.ActionLink("Create New", "Create") %>
	</p>

</asp:Content>

